package com.xyy.yueshijia.base;

/**
 * Created by lxs on 2017/2/8.
 */

public abstract class MvpFragment<P extends BasePresenter>
        extends BaseFragment
        implements BaseView {

    protected  P presenter;

    public abstract P initPresenter();

    @Override
    protected void initBefore() {
        super.initBefore();
        presenter = initPresenter();
        presenter.addView(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        presenter.dettachView();
    }
}
